<template>
	<view
		:style="{
			'background': nodeModel.background,
			'marginTop': nodeModel.marginTop+'rpx',
			'marginBottom': nodeModel.marginBottom+'rpx',
			'marginLeft': nodeModel.marginLeft+'rpx',
			'marginRight': nodeModel.marginLeft+'rpx',
			'paddingTop': nodeModel.paddingTop+'rpx',
			'paddingBottom': nodeModel.paddingBottom+'rpx',
			'paddingLeft': nodeModel.paddingLeft+'rpx',
			'paddingRight': nodeModel.paddingRight+'rpx',
		}">
		<view :style="{
			'width': nodeModel.widthForCover1+'rpx'
		  }">
			<u-swiper v-if='nodeModel.advertList.length>1' :list="nodeModel.advertList" keyName='coverUrl' :height="nodeModel.heightForCover1+'rpx'" :interval='nodeModel.duration' :radius='nodeModel.borderRadiusForCover1' :imgMode='nodeModel.modeForCover1' indicator circular @click="itemHandle"></u-swiper>
			<u-swiper v-else mode="none" :list="nodeModel.advertList" keyName='coverUrl' :height="nodeModel.heightForCover1+'rpx'" :radius='nodeModel.borderRadiusForCover1' :imgMode='nodeModel.modeForCover1' @click="itemHandle"></u-swiper>
		</view>
	</view>
</template>

<script>
	export default{
		name: 'jc-swiper',
		props: {
			nodeModel: {
				type: Object,
				default: {}
			}
		},
		data() {
			return {
			}
		},
		methods:{
			itemHandle(e){
				var advert = this.nodeModel.advertList[e]
				// if(advert.fileType=='image'){
					this.$emit('itemHandle', this.nodeModel.advertList[e])
				// }
			}
		}
	}
</script>

<style>
</style>
